<!DOCTYPE html>
<html>

<head>
    <title>编辑待办事项</title>
    <style>
        body {
            background-color: #f5f5f5;
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
        }

        .edit-form {
            max-width: 600px;
            margin: 20px auto;
            padding: 20px;
            background: white;
            border: 1px solid #ddd;
            border-radius: 5px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        h1 {
            text-align: center;
            color: #333;
            margin-bottom: 30px;
        }

        .form-group {
            margin-bottom: 15px;
        }

        .form-group label {
            display: block;
            margin-bottom: 5px;
            color: #555;
            font-weight: bold;
        }

        .form-group input,
        .form-group textarea {
            width: 100%;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
            font-size: 14px;
        }

        .form-group textarea {
            height: 100px;
            resize: vertical;
        }

        .button-group {
            margin-top: 20px;
            display: flex;
            gap: 10px;
        }

        .button-group button {
            padding: 8px 15px;
            margin-right: 10px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
        }

        .button-group button[type="submit"] {
            background-color: #28a745;
            color: white;
        }

        .button-group button[type="submit"]:hover {
            background-color: #218838;
        }

        .button-group button[type="button"] {
            background-color: #6c757d;
            color: white;
        }

        .button-group button[type="button"]:hover {
            background-color: #5a6268;
        }
    </style>
</head>

<body>
    <div class="edit-form">
        <h1>编辑待办事项</h1>
        <form action="/todos/<%= todo.id %>/edit" method="POST">
            <div class="form-group">
                <label>标题：</label>
                <input type="text" name="title" value="<%= todo.title %>" required>
            </div>
            <div class="form-group">
                <label>描述：</label>
                <textarea name="description"><%= todo.description %></textarea>
            </div>
            <div class="button-group">
                <button type="submit">保存</button>
                <a href="/todos"><button type="button">取消</button></a>
            </div>
        </form>
    </div>
</body>

</html>